<?php include_once("header.html")?>
<script src="<?php echo $www_site_url?>/public/js/calendar.js" type="text/javascript"></script>
<div id="append"></div>
<div id="wrap">  <br />

<?php include_once("home_left.html")?>
<div class="admincontent">

<div id="tabsD" style="width:100%">
  <ul>
    <li <?php if($type=='corpstats') echo 'class="on"';?>><a href="/client.php/home/corpstats" title="<?php echo lang("assignmentprogress");?>"><span><?php echo lang("assignmentprogress");?></span></a></li>
    <li <?php if($type=='corprank') echo 'class="on"';?>><a href="/client.php/home/corprank" title="<?php echo lang("ranking");?>"><span><?php echo lang("ranking");?></span></a></li>

   <li style="float:right;"><?php echo lang("select_brand")?>:<input name="selbrand" type="text" class="ClocationInput" onclick="showmitibrands();" id="selbrand" value="<?php if(isset($brand) && !empty($brand)){ echo splitx($brand['b_name']); }?>" /></li>
  </ul>
</div>
<br />
<br />

<br />
<div id="brandlist" style="width: 170px; border: 1px solid #B5CFD9; background:#fefefe;display:none; position:absolute;z-index:999;">
  <ul>
  <?php
       if(isset($brands) && is_array($brands)){
         foreach ($brands as $b){
                ?>
	<li style="padding:2px;"> <label><a href="/client.php?action=home&view=corpstats&selbrands=<?php echo $b['b_id']?>"><?php echo splitx($b['b_name']);?></a></label></li>
	  <?php
			}
      }
       ?>
     </ul>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div class="table2TitleBg">
      <div class="table2TitleBg2">
      	<div class="table2Title"><div class="table2TitleLeft"><span><?php echo $corp['c_title']?></span></div></div>
      </div>
    </div></td>
  </tr>
  <tr>

    <td>



    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="table2LeftBorder"></td>
        <td>
         <?php echo lang("completed_visits");?>: <?php echo $totalcompleted;?>
                   </td>
        <td class="table2RightBorder">


        </td>
      </tr>
      <tr>
        <td class="table2BottomLeft"></td>
        <td class="table2Bottom"></td>
        <td class="table2BottomRight"></td>
      </tr>

    </table></td>
  </tr>
</table>
<br />
<?php if(is_array($stores)){
	foreach ($stores as $s){?>

<table width="47%" border="0" cellspacing="0" cellpadding="0" style="float:left;margin:10px 22px 10px 0;">
  <tr>
    <td><div class="table2TitleBg">
      <div class="table2TitleBg2">
      	<div class="table2Title"><div class="table2TitleLeft"><span><?php echo splitx(stripslashes($s['cs_name']))?></span></div></div>
      </div>
    </div></td>
  </tr>
  <tr>

    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="table2LeftBorder"></td>
        <td>
         <?php echo lang("latest_visits");?>: <?php echo $s['store_latest_completed']['a_fdate'];?><br />
         <?php echo lang("completed_visits");?>: <?php echo $s['store_completed'];?><br />
         <?php echo lang("to_visit");?> :<?php echo $s['store_next_assignment']['a_sdate'];?> / <?php echo $s['store_next_assignment']['a_edate'];?>
                   </td>

        <td class="table2RightBorder"></td>
      </tr>
      <tr>
        <td class="table2BottomLeft"></td>
        <td class="table2Bottom"></td>
        <td class="table2BottomRight"></td>
      </tr>

    </table></td>
  </tr>
</table>

<?php
	}}?>

</div>

</div>


<?php include_once("footer.html")?>
